import os
import sqlite3

def project_show(db_path): # 登陆后显示项目
    db_path = db_path.replace("\\", "\\\\")
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    cursor.execute(f"select `项目ID`, `项目名称` from `projects`;")
    results = cursor.fetchall()
    cursor.close()
    conn.close()
    # print(results)
    return results # for result in results 读取每一行

"""
db_path = os.path.join(os.getcwd(), "test.db")
project_show(db_path)
"""